<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>编辑授信流程</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">
  <link rel="stylesheet" href="${re.contextPath}/plugin/lenos/main.css"/>
  <script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js" charset="utf-8"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js" charset="utf-8"></script>
  <script type="text/javascript" src="${re.contextPath}/plugin/tools/util.js" charset="utf-8"></script>
  <script>
  	//iframe自适应高度
	function iFrameHeight(frame) {   
	  	var ifm= document.getElementById(frame);	
	  	if(ifm==null) return;
	  	var subWeb = document.frames ? document.frames[frame].document : ifm.contentDocument;    
	  	if(ifm != null && subWeb != null) {
	  	   ifm.height = subWeb.getElementsByTagName("html")[0].offsetHeight;
	  	}
	} 
  </script>
</head>
<body>
<div >
	<div>
	    <div class="layui-form-item" >
	      审核意见：<input name="opinion" id="spyj">
	      <span id="save">
		      <button class="layui-btn layui-btn-normal" data-type="save">
		        	保存
		      </button>
			   <button class="layui-btn layui-btn-normal" id="no" data-type="no" lay-submit>
		        	回退
		      </button>
		  </span>

	    </div>
	 </div>
</div>
<script>
layui.use('element', function(){
  var element = layui.element;
  var scspId=getUrlParam("scspId")||"",
  	  custId=getUrlParam("custId")||"",
  	  zyxm=getUrlParam("zyxm")||"",
      stat=getUrlParam("stat")||"1",  //0:流程查看 1：流程编辑  //2：任务编辑
      taskId=getUrlParam("taskId")||"", //任务编辑时流程任务id
      taskName=getUrlParam("taskName")||""; //任务编辑时流程任务名称

  var active = {
  	  save: function(){  //保存
		  var spyj = document.getElementById("spyj").value;
          layerAjax('completeTask',{"taskId":taskId,"taskName":taskName,"opinion":spyj,"opId":"1","flag":true},'taskList');
  	  },
  	  callprint: function(){ //打印
  	  	myTabsFrame.window.myprint(); //调用子窗口方法
  	  },
      close: function (){ //关闭
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
        
      },
      no: function(){
      	if(stat!='3'){
	    	layerAjax('agent/complete',{"taskId":taskId,"taskName":taskName,"flag":false},'taskList');
	    }else{
	    	myTabsFrame.window.$("#no").click();
	    }
	    return false;
      }
      
  };
  eleClick(active,'.layui-form-item .layui-btn');
});
</script>
</body>
</html>